# -*- coding: utf-8 -*-
# @Time    : 2020/3/17 下午7:45
# @Author  : lilong


class ClassA:
    name = "type test"


a = ClassA()
b = 3.0

print(type(a))
print(type(b))
print(type("This is string"))
print()

print(a.__class__)
print(b.__class__)
print()

ClassVariable = type('ClassA', (object,), dict(name="type test"))
a = ClassVariable()
print(type(a))
print(a.name)
print("####################")

# isinstance()
# ====================================
class BaseClass:
    name = "Base"


class SubClass(BaseClass):
    pass


base = BaseClass()
sub = SubClass()

print(isinstance(base, BaseClass))
print(isinstance(base, SubClass))
print()

print(isinstance(sub, SubClass))
print(isinstance(sub, BaseClass))


print(issubclass(SubClass, BaseClass))
print(issubclass(BaseClass, SubClass))
print(SubClass.__bases__)
